package com.spark3

import com.alibaba.fastjson.JSON

import scala.collection.mutable
import scala.collection.JavaConverters._

object MainTest4 {

  def main(args: Array[String]): Unit = {


    val content = "{\"spark.driver.memory\":\"8g\",\"spark.sql.shuffle.partitions\":\"300\"}"
//    println(classOf[java.util.HashMap[String,String]])
    val map = JSON.parseObject(content,classOf[java.util.HashMap[String,String]])
    val map02 = JSON.parseObject(content,classOf[mutable.HashMap[String,String]])

//    val a = new mutable.HashMap[String,String]() ++ map.asScala
//    println(a)


   val a = map.asScala
   println(a)



//   val a = map.asScala.asInstanceOf[mutable.HashMap[String,String]]


    if (a.isInstanceOf[mutable.HashMap[String,String]]){
      println("yes")
    }else{
      println("no")
    }

    val colors = mutable.Map("red" -> "#FF0000",
      "azure" -> "#F0FFFF",
      "peru" -> "#CD853F")


    println(colors)


    val b = colors.asInstanceOf[mutable.HashMap[String,String]]

        if (b.isInstanceOf[mutable.HashMap[String,String]]){
          println("yes")
        }else{
          println("no")
        }


  }


}
